home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- # Build index on address
- # Fields of articles.db: article,ID,address,author,subject,date
-
- # where your news archiving directory is
- HTTPD_NEWSHOME=/usr1/paul/news
-
- cd $HTTPD_NEWSHOME/groups
- if [ ! -r newarticles ] ; then
- exit # no new articles
- fi
-
- cat articles.db newarticles | sort -T . -ft' ' | uniq >tmpidx$$
- mv tmpidx$$ articles.db
-
- awk -F' ' 'BEGIN{OFS="\t"}
- {print $3,$1}' articles.db | sort -T . -ft' ' >tmpidx$$
- mv tmpidx$$ by_addr.idx
-
- # now index on article number
- awk -F' ' 'BEGIN{OFS="\t"}
- {print $2,$1}' articles.db | sort -T . -ft' ' >tmpidx$$
- mv tmpidx$$ by_id.idx
-
- rm -f newarticles tmpidx$$
-